// 导入axios模块
import axios from '@/utils/axios'

// 获取搜索建议
export const suggestions = keywords => {
  return axios({
    method: 'GET',
    url: '/app/v1_0/suggestion',
    params: {
      q: keywords
    }
  })
}

// 获取搜索结果
export const searchResults = params => {
  return axios({
    method: 'GET',
    url: '/app/v1_0/search',
    params
  })
}

// 获取用户搜索历史
export const userHistory = () => {
  return axios({
    method: 'GET',
    url: '/app/v1_0/search/histories'
  })
}

// 删除用户搜索历史
export const delUserHistory = () => {
  return axios({
    method: 'DELETE',
    url: '/app/v1_0/search/histories'
  })
}
